<script lang="tsx">
import useRender from "@/utils/hooks/render";
import { inject } from "vue";
import { CommmonItem } from "./index.vue";

export default {
  props: {
    item: {
      type: Object as unknown as () => CommmonItem,
      required: true,
    },
    upperValue: {},
  },
  setup(props, ctx) {
    const rootModal = inject<Record<string, any>>("rootModal")!;

    useRender(() => (
      <nut-cell
        title={rootModal[props.item.title || ""] || ""}
        desc={props.upperValue[props.item.dataIndex]}
        {...(props.item.cellProps || {})}
      ></nut-cell>
    ));

    return { rootModal };
  },
};
</script>

<style lang="scss"></style>
